package com.mzj.saas.mservice.application.repository;

import com.mzj.saas.mservice.application.entity.ApprovalProcessNode;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface ApprovalProcessNodeRepository extends PagingAndSortingRepository<ApprovalProcessNode, Long>, JpaSpecificationExecutor<ApprovalProcessNode>, JpaRepository<ApprovalProcessNode,Long> {
@Transactional
void deleteByApprovalProcessId(Long approvalProcessId);
List<ApprovalProcessNode> findByApprovalProcessId(Long approvalProcessId);
List<ApprovalProcessNode> findByOrgIdIn(List<Long> orgIds);
ApprovalProcessNode findByApprovalProcessIdAndOrgId(Long approvalProcessId,Long orgId);
    List<ApprovalProcessNode> findByOrgIdInAndStatus(List<Long> orgIds,Integer status);
}
